04. 视频 + 文本:第一个聚合函数 - COUNT
COUNT
计算表格中的行数
试着手动数数每个表格的行数。以下是计算 accounts 表格中的行数示例:
SELECT COUNT(*)
FROM accounts;
我们也可以轻松地选择一列来放置聚合函数:
SELECT COUNT(accounts.id)
FROM accounts;
上述两个语句是对等的,但是并不始终这样,我们将在下个视频中见到这一例外情况。
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: sql-evaluator
- Opened files (when workspace is loaded): n/a